
<form id="shopcategory" name="shopcategory" method="post" action="shopcategory.manage.php">
<input type="hidden" name="action" value="save" />
 <table class="from_table">
  <tr>
    <th class="th1"><tpl> $langShopClassName </tpl>：</th><td width="530" class="td1"><input name="txtClassName" class="txtinput" type="text" id="txtClassName" value="<tpl> $category_array.class_name </tpl>" maxlength="30" /></td>
   </tr>
   <tr>
	<th class="th1"><tpl> $langShopClassParent </tpl>：</th>
	<td width="530" class="td1"><tpl> $select_parent_category </tpl></td>
   </tr>
   <tr>
	<th class="th1"><tpl> $langShopClassProperty </tpl>：</th>
	<td width="530" class="td1"><tpl> $radio_category_property </tpl></td>
   </tr>
   <tr>
	<th class="th1"><tpl> $langCSort </tpl>：</th>
	<td width="530" class="td1"><input name="txtClassSort" class="txtinput" type="text" id="txtClassSort" value="<tpl> $category_array.class_sort </tpl>" size="5" maxlength="5" /></td>
   </tr>
   <tr>
	<th class="th1"><tpl> $langShopClassState </tpl>：</th>
	<td width="530" class="td1"><tpl> $radio_category_state </tpl></td>
   </tr>
   <tr>
	<td>
	  </td>
	<td width="530">
	<span class="btn_left">
	<input type="submit" class="btn_submit" name="Submit" value="<tpl> $langCsave </tpl>" /> 
	</span>
	<span class="btn_left">
			<input id="butt_list" class="btn_submit" type="button" value="<tpl> $langSysShopReturnList </tpl>" />
		</span>	
			
	  </td>
  </tr></table>
		<input name="hideClassId" type="hidden" id="hideClassId" value="<tpl> $category_array.class_id </tpl>" /><input name="hideOperate" type="hidden" id="hideOperate" value="<tpl> $category_operate </tpl>" />
  
</form>


<script>
$(document).ready(function() {
//焦点样式
    $('input[@type="text"],input[@type="password"],textarea').focus(function() { $(this).addClass('input_onFocus') }).blur(function() { $(this).removeClass('input_onFocus') });

	//返回列表
	$('#butt_list').click(function(){
		ShowDiv = "result_content";
		getPageContent("shopcategory.manage.php?action=ajax_list");
	})

	hideMessage();		
//编辑
	var options = {
		beforeSubmit:  function(){showLoading(showSaveText);},
		success:       function(msg){
							hideLoading();
							showMessage(msg.message,msg.type);
							if(msg.type == '1'){
								ShowDiv	= 'result_content';
								getPageContent("shopcategory.manage.php?action=ajax_list");
							}
						},
		type:      'post',
		dataType:  'json'
	};
	
	//对添加表单做的验证定义
	$("#shopcategory").validate({
		errorClass: "wrong",
		rules: {
			txtClassName: {required:true}
		},
		messages: {
			txtClassName: {required: "<tpl> $langSysShopPleaseFillInClass </tpl>"}
		},
		submitHandler: function() {
			$('#shopcategory').ajaxSubmit(options);
		}
	});
});
</script>